#pragma once

#include "MyActiveInterface.h"
#include "MyMessageHandler.h"

namespace CO { namespace MyGroupNamespace { namespace MyPackageNamespace {

class MyActiveObject :
	public SpiFoundation::RoomFW::ActiveObject,
	public MyActiveInterface
{
public:

	//
	// Constructor/Destructor.
	//
	MyActiveObject(void);
	virtual ~MyActiveObject(void);

	//
	// ISystemComponent overrides.
	//
	virtual bool initialize(SpiFoundation::Configuration::ConfigKey& configRoot);

	//
	// IActiveObject overrides.
	//
	virtual SpiFoundation::RoomFW::ObjectId getObjectId(void) const;
	virtual const char* getObjectName(void) const;

protected:

	//
	// ActiveObject overrides.
	//
	virtual void handle(SpiFoundation::RoomFW::RoomMessageSP message);

	//
	// Hook methods called by DefaultErrorReporting.
	//
	virtual void onError(SpiFoundation::ErrorHandling::IError& e);
	virtual void onException(std::exception& e);
	virtual void onCatchAllException();

private:

	//
	// Message handler for a more modular design.
	//
	MyMessageHandler::Ptr messageHandler_;

	//
	// TODO:  Add private attributes.
	//
	long myConfigValue_;
};
//
// TODO:  Add a smart pointer typedef for your class.
//
typedef ::boost::shared_ptr<MyActiveObject> MyActiveObjectSP;

}}} // End namespace
